// unuseful
const path = require('path');
const webpack = require('webpack');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const { WebpackManifestPlugin } = require('webpack-manifest-plugin');

const IS_DEV = process.env.NODE_ENV === 'development';

module.exports = {
    entry: {
        vendor: ['react', 'react-dom', 'react-router', 'react-router-dom', 'history', 'lodash', 'lodash/debounce'],
        echarts: ['echarts-for-react', 'echarts'],
    },
    output: {
        path: path.resolve(__dirname, 'dist/dll'),
        filename: '[name].[contenthash:10].dll.js',
    },
    plugins: [
        new CleanWebpackPlugin({
            verbose: IS_DEV,
        }),
        new webpack.DllPlugin({
            path: path.join(__dirname, 'dist/dll/[name]-manifest.json'),
            name: '[name]'
        }),
        new WebpackManifestPlugin(),
    ]
};
